<link rel="stylesheet" type="text/css" href="css/thickbox.css" media="screen" />

<div class="center">

<a class="button preloader" href="<? echo redirect_str(PAGE_PHOTOGALERIES); ?>">ZPĚT DO VÝBĚRU FOTOGALERIE</a><br /><br />

<?php
$album = $_GET['album'];
$small_dir = PHOTO_GALLERY_PATH.$album."/small";
if ($handle = opendir($small_dir)) {
  while ($file = readdir($handle)) {
      if(isfile($file))
        $polozky[count($polozky)] = $file;
  }
  closedir($handle);
  sort($polozky);
}

reset($polozky);

$current = $_GET['current'];
  
$rows = count($polozky);        //celkový počet fotek v galerii

$paginator = new Paginator(16, 3, $current, $rows, PAGE_PHOTOS, add_par("album=".$album));

$paginator->show();

echo "<table class='centered medium-table'>";

for ($i = 0 ;$i < $rows ;$i++) {
  $val = $polozky[$i];
  
  $path_big = PHOTO_GALLERY_PATH.$album."/".$val;
  $path_small = $small_dir."/".$val;

  if(($i >= $paginator->getFirstPageIndex()) && ($i < $paginator->getFirstPageIndex() + $paginator->getPageSubjects())) {
    if($i % 4 == 0) echo "<tr>";
    echo "<td><a href='$path_big' class='thickbox img-link' rel='gallery-plants'>";
    echo "<img class='pic' src='$path_small' alt='Foto $i' /></a>";
    echo "</td>";
    if(($i + 1) % 4 == 0) echo "</tr>"; 
  } else {
    if($i % 4 == 0) echo "<tr style='display: none;'>";
    echo "<td><a href='$path_big' class='thickbox' rel='gallery-plants'></a></td>";
    if(($i + 1) % 4 == 0) echo "</tr>"; 
  }
  
}
echo "</table>";

$paginator->show();

?>
</div>

<div id='velky-obrazek'>
  <a href='#' onclick="Schovat('velky-obrazek')" title='Zavřít'>Zavřít</a><br /><br />
  <img src='' id='velkyobrazek' alt='načítám fotku...' onclick="Schovat('velky-obrazek')" style='cursor: pointer' />
</div>